package com.king.factory.abstractFac;

public class Consumer {
    public static void main(String[] args) {
        System.out.println("==============xiaomi==============");
        XiaomiFactory xiaomiFactory = new XiaomiFactory();
        XiaomiPhone xiaomiphone = (XiaomiPhone) xiaomiFactory.phone();
        xiaomiphone.open();
        xiaomiphone.call();
        XiaomiRouter xiaomiRouter = (XiaomiRouter) xiaomiFactory.router();
        xiaomiRouter.openWifi();
        xiaomiRouter.setting();
        System.out.println("===============huawei============");
        HuaweiFactory huaweiFactory = new HuaweiFactory();
        HuaweiPhone huaweiPhone = (HuaweiPhone) huaweiFactory.phone();
        huaweiPhone.open();
        huaweiPhone.call();
        HuaweiRouter huaweiRouter = (HuaweiRouter) huaweiFactory.router();
        huaweiRouter.openWifi();
        huaweiRouter.setting();
    }
}
